The present invention relates to a playing method capable of synchronizing execution of an image display, lighting of an LED, the operation of a vibrator, and other functions applied between MIDIs and to devices, such as other sound playback with timings such as sound production of a given specific musical instrument, beats, a specified time, etc. during performances of MIDI music at a cellular phone, a personal digital assistant (PDA), a game machine, a MIDI device, etc.
An author ring device capable of simply processing data employed in a Karaoke machine using an electronic sound source based on the MIDI standard to synchronize music and an image, and titles and the like has been disclosed in a patent document 1 (Japanese Patent Laid-Open No. Hei 6(1994)-242788).
In a system equipped with a MIDI music playback device with a sequencer built therein, such as a cellular phone and a PDA, an interrupt from the MIDI music playback device to a host CPU has heretofore been generated to notify timing provided to synchronize music and each event with each other to the host CPU when the sequencer has received a synchronous message during the analysis of a MIDI message, using, as a method for synchronizing MIDI musical performance with other functions of the system, such as an image, a sound, etc. at other applications like Karaoke and games, a method for inserting a synchronous message in MIDI music in advance or a method for adding an extension message to MIDI music so as to be synchronized with sound production of a specific musical instrument.
The conventional method is accompanied by the problem that when a plurality of events occur simultaneously and synchronous events occur continuously, interrupt processing to the host CPU is not in time and interrupts overlap one another so that all the interrupts cannot be defected on the host CPU side, whereby the corresponding synchronous event is unexecuted and not in time for the next synchronism detection timing for originally executing another event.
Also, a problem arises in that when the executing order of events is specified in advance from the head of music, this cannot adapt to processing where musical performance is reproduced from the middle of music, and in order to properly execute each event in this case, the number of synchronous events taken till a playback start time at the middle of the music is held in advance, or the host CPU must count the number of event occurrences from the start of musical performance to the playback start time at the middle of the music by analyzing MIDI music in advance.
A conventional MIDI playing method will be explained using a flowchart shown in FIG. 3.
The MIDI music playback device performs sequencer processing for message-analyzing MIDI data inputted to an FIFO (data input memory) in order and carries out music playback processing in accordance with the analyzed message. When the message is found to be analyzed as the synchronous message in a MIDI message analysis processing step (S31), the MIDI music playback device performs processing for an interrupt request to the host CPU (S32) and returns to the sequencer processing.
When the host CPU accepts the interrupt request from the MIDI music playback device, it performs interrupt processing. The host CPU processes events (let's consider that assuming that event processes are executed in order in accordance with synchronous events from the start of music, files having designated the events are prepared in generating order) such as image descriptions and sound playback in designated order within the interrupt processing (S33) and terminates the interrupt processing.
When a plurality of new synchronous messages are processed in accordance with the sequencer processing on the MIDI music playback device side during the interrupt processing on the host CPU side, the host CPU cannot detect a new interrupt, so that there is a difference between the number of interrupt occurrences and the number of the synchronous messages, thus resulting in a shift in synchronous event.